#include <iostream>
#include <cmath>
#include <limits>
#include <stack>
#include <cstring>
#include <cstdlib>
#include <ctype.h>
using namespace std;
int p(char c)
{
switch(c)
	{
		case '+':return 0;break;
		case '-':return 1;break;
		case '*':return 2;break;
		case '/':return 3;break;
		case '(':return 4;break;
		case ')':return 5;break;
		case '=':return 6;break;
	}
}
double cal(double a,double b,char c)
{
	if(c=='+')
	return a+b;
	if(c=='-')
	return a-b;
	if(c=='*')
	return a*b;
	if(c=='/')
	return a/b;
}
char compare(char a,char b)
{
	
	char oper[7][8]={">><<<>>",">><<<>>",">>>><>>",  
                ">>>><>>","<<<<<= ",">>>> >>","<<<<< ="};  
    int x=p(a);
int y=p(b);
    return oper[x][y];
}

int main()
{
 char str[105];
	while(scanf("%s",str)!=EOF)
	{
		while(!num.empty())
		num.pop();
		while(!ch.empty())
		ch.pop(); 
		ch.push('=');
		char temp[30];
		int len=strlen(str),k=0;
		str[len]='=';str[len+1]='\0'; 
		for(int i=0;i<=len;)
		{
			if(isdigit(str[i])||str[i]=='.')
			{
				temp[k++]=str[i];
				i++;
				continue;
			}
			if(k!=0)
			{
				num.push(atof(temp));
				memset(temp,0,sizeof(temp));
				k=0;
			}
			switch(compare(ch.top(),str[i]))
			{
				case '<':ch.push(str[i]);i++;break;
				case '=':ch.pop();i++;break;
				case '>':{
					double a=num.top();num.pop();
					double b=num.top();num.pop();
					num.push(cal(b,a,ch.top()));
					ch.pop();
					break;
				}
			}
		}                          
		printf("%.4lf\n",num.top());
		num.pop();
	}
	return 0; 


}
